<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')->hourly();
        $schedule->command('command:changepresettleprice')->dailyAt('23:00');
        // $schedule->command('command:dingdinggetres')->everyMinute();


        // $schedule->command('command:DingDingGetDepartmentList')->dailyAt('00:50');
        // $schedule->command('command:DingDingGetDepartmentUserList')->dailyAt('01:00');

        //$schedule->command('command:dingdinggetres')->everyMinute();

        $schedule->command('command:ReportForms')->lastDayOfMonth('23:59');

        //Tplus账套 token 续期
        $schedule->command('command:AutoRefreshToken')->dailyAt("00:05");

        //获取tplus账套
        $schedule->command('command:Account')->dailyAt("00:10");

        //销售毛利分析
        $schedule->command('command:SaleGrossProfitAnalysis')->twiceDaily(0,13);

        //其他入库
        //$schedule->command('command:OtherInbound')->twiceDaily(0,13);

        //其他出库
        //$schedule->command('command:OtherOutbound')->twiceDaily(0,13);

        //入库调整单
        //$schedule->command('command:InboundAdjustment')->twiceDaily(0,13);

        //出库调整
        //$schedule->command('command:OutboundAdjustment')->twiceDaily(0,13);

        //盘点单
        //$schedule->command('command:CountOrder')->twiceDaily(0,13);
        //采购发票
        //$schedule->command('command:PurchaseInvoice')->twiceDaily(0,13);

        //销售发票
        //$schedule->command('command:SaleInvoice')->twiceDaily(0,13);

        //调拨单
        //$schedule->command('command:TransferOrder')->twiceDaily(0,13);
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');
        require base_path('routes/console.php');
    }
}
